package com.note.back.pojo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@Data
public class User {
    @NotNull
    private Integer id;//主键ID
    @Pattern(regexp = "^\\S{5,16}$")
    private String account;//账号
    @Pattern(regexp = "^\\S{5,16}$")
    private String password;//密码
    @JsonIgnore//让springmvc把当前对象转换成json格式时，忽略password，最终的json字符串就没有password属性了
    private String salt;
    private String username;//用户名
    @Email(message = "请输入有效的邮箱地址")
    private String email;
}
